<%@ page import="SSP.*" %>
<% 

int customerid = Integer.parseInt((session.getAttribute("customerid")+ ""));
//int locationid = Integer.parseInt((session.getAttribute("locationid")+ ""));

String equipmentid = request.getParameter("equipmentid");
int servicetypeid = Integer.parseInt(request.getParameter("servicetype"));
   

String priorityid = request.getParameter("priority");
String pmid = request.getParameter("pm");
String problemdescription = request.getParameter("problemdescription");
String contactname = request.getParameter("name");
String contactphone = request.getParameter("phone");
String contactemail = request.getParameter("email");



if (pmid == null) {
	pmid = "0";
}

//int pmid=Integer.parseInt(spmid);

/*
if (servicetypeid !=5){

pmid=-1;
}
*/

ServiceOrder so = new ServiceOrder();
so.setCustomerid(customerid);
//so.setLocationid(locationid);
int success =0;
so.setEquipmentid(Integer.parseInt(equipmentid));
so.setServicetypeid(servicetypeid);
so.setPriorityid(Integer.parseInt(priorityid));
so.setPmid(Integer.parseInt(pmid));
so.setProblemdescription(problemdescription);
so.setContactname(contactname);
so.setContactphone(contactphone);
so.setContactemail(contactemail);
so.ServiceOrderCreate();

response.sendRedirect("newsoconfirm.jsp");
//response.sendRedirect("newsoconfirm.jsp?serviceorderid="+request.getParameter("serviceorderid").toString() + "&u=successful");
%>
